/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package core;

import java.util.ArrayList;
import java.util.Collection;

/**
 *
 * @author Ahlberg
 */
public class Program extends SuperSchool
{
    private String programId;
    private Collection<Course> courses;
    /**
     * Deafult constructor.
     */
    public Program()
    {
    }
    /**
     *
     * @param id
     * @param name
     * @param description
     * @param webLink
     * @param programId
     */
    public Program(long id, String name,
            String description, String webLink, String programId)
    {

        super(id, name, description, webLink);
        this.programId = programId;
        this.courses = new ArrayList<Course>();
    }
    /**
     *
     * @param id
     * @param name
     * @param description
     * @param webLink
     * @param programId
     * @param courses
     */
    public Program(long id, String name,
            String description, String webLink, String programId, Collection<Course> courses)
    {

        super(id, name, description, webLink);
        this.programId = programId;
        this.courses = courses;
    }
    /**
     *
     * @return
     */
    public String getProgramId()
    {
        return programId;
    }
    /**
     *
     * @return
     */
    public Collection<Course> getCourses(){
        return courses;
    }

    /**
     *
     * @param programId
     */
    public void setProgramId(String programId)
    {
        this.programId = programId;
    }
    /**
     *
     * @param courses
     */
    public void setCourses(Collection<Course> courses){
        this.courses = courses;
    }
    
    /**
     *
     * @param course
     * @return
     */
     public boolean addCourse(Course course){
         return courses.add(course);
     }
     /**
      *
      * @param course
      * @return
      */
     public Boolean deleteCourse(Course course)
     {
         return courses.remove(course);
     }
     /**
      *
      * @param p
      * @return
      */
     public boolean equals(Program p)
     {
        return super.equals(p);
     }
     /**
      *
      * @return
      */
     @Override
     public String toString()
     {
        String str = super.toString();
        str +=  "programId: " + programId + "\n";
        str += "PROGRAMS:\n";
        for(Course c : courses)
            str += c.toString();
        return str;
    }
}
